/*
** main.c for  in /home/lund/Projets/SysUnixAv/seutrace
** 
** Made by florian dewulf
** Login   <dewulf_f@epitech.net>
** 
** Started on  Tue Apr 30 14:56:55 2013 florian dewulf
** Last update Thu May  2 15:04:23 2013 florian dewulf
*/

#include	<stdio.h>
#include	<string.h>
#include	"strace.h"

static int	is_num(char *str)
{
  int		i;

  i = -1;
  while (str[++i])
    if (!(str[i] <= '9' && str[i] >= '0'))
      return (0);
  return (1);
}

int		main(int ac, char **av)
{
  if (ac < 2 || ac >= 4 || (ac == 3 && strcmp(av[1], "-p") && !is_num(av[2])))
    return (printf("Usage : ./strace [exec] || [-p pid]\n"));
  else if (ac == 2)
    strace_noarg(av[1]);
  else
    strace_arg(av[2]);
  return (0);
}
